<template>


  <div ref="vantaRef" style="background: linear-gradient(0deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)), linear-gradient(135deg, #e9f1ff -1%, #f1e9ff 100%);
  min-height: 100%;
  position: relative;
  display: block ">
    <div
    class="nav-bar"
    >
      <el-image class="nav-logo" @click="backOsredm" :src="osredmLogo" />
      <a class="nav-f" href="https://www.osredm.com/" >首页</a>
      <a class="nav-s" href="https://www.osredm.com/explore/all" >开源项目</a>
      <a class="nav-s" href="https://www.osredm.com/task" >创客空间</a>
      <a class="nav-s" href="https://fc.osredm.com/competitions" >开放竞赛</a>
      <a class="nav-s" href="https://fc.osredm.com/forums" >论坛交流</a>
    </div>
    <div  class="container" >
<!--      <div class="banner-main" :style="{backgroundImage:'url('+require('../assets/new-banner.svg')+')'}" style=" background-size:cover; ">-->


      <!--在线工具导航-->
      <div  class="animate__animated animate__fadeIn main-card">

        <div class="card-border">
          <el-card shadow="never"  >

            <div class="tools-details-des">

              <img style=" height: 80px" :src=tools.toolsImg alt=""/>
              <div class="tools-main-des">
                <p class="tools-des">{{tools.toolsTitle}}</p>
                <p class="tools-title">{{tools.toolsTag}}</p>
              </div>
              <div class="tools-main-des">
                <p>{{tools.toolsDes}}</p>
              </div>
            </div>

            <div>
              <div v-for="(child) in tools.toolsChild" :key="child.toolsChildId">
                <p class="tools-child-des">{{ child.toolsTitle }}</p>
                <div style="text-align: left; display: flex; flex-wrap: wrap  ">
                  <div class="tools-card" v-for="(card, cardIndex) in child.cardList" :key="`${child.toolsChildId}-${cardIndex}`" @click="openWebPage(card.cardLink)">
                    <img :style="{ marginLeft: '15px', height: '60px' }" :src="card.cardImg" alt=""/>

                    <el-popover
                        placement="bottom"
                        width="200"
                        trigger="hover"
                        :content="card.cardDes"
                    >
                      <div slot="reference">
                        <p class="tools-text">{{ card.cardTitle }}</p>
                        <p class="tools-text1">{{ card.cardDes }}</p>
                      </div>


                    </el-popover>
                  </div>
                </div>
              </div>

            </div>



          </el-card>


        </div>











      </div>


    </div>
    <Footer></Footer>
  </div>
</template>

<script>

import pageUtils from "@/utils/pageUtils";
import Footer from "@/components/Footer"
import "../assets/font/font.scss";
import 'animate.css';

import * as Three from 'three';
import vantaFog from "vanta/src/vanta.fog";
import mindspore from "@/assets/json/toolsdata-mindspore";
import deepseekTools from "@/assets/json/toolsdata-deepseek";
import {Message} from "element-ui";

import pp from "@/assets/json/toolsdata-pp"
import qwen from "@/assets/json/toolsdata-qwen";
import zhipu from "@/assets/json/toolsdata-zhipu";

import apache from "@/assets/json/toolsdata-apache";

export default {

  name: "ToolsDetails",
  data(){
    return{
      apache,
      deepseekTools,

      pp,
      mindspore,

      tools:{
        toolsImg: "",
        toolsTitle: "",
        toolsTag: "",
        toolsDes:"",


        toolsChild:[{
          toolsChildId: 0,
          toolsTitle: "",
          cardList:[
            {
              cardImg:"",
              cardTitle:"",
              cardDes:"",
              cardLink:""
            }
          ]
        }],
      },


      osredmLogo: require("@/assets/logo/osredm-logo-black-new.png"),

      bingSearchUrl: 'https://cn.bing.com/search?q=' + this.searchInput,
      searchInput : '',
      buttonImgList : [
        require("@/assets/button-assets/tools-button-ns.svg"),
        require("@/assets/button-assets/tools-button-ns.svg"),
        require("@/assets/button-assets/tools-button-ns.svg"),
        require("@/assets/button-assets/tools-button-ns.svg"),
        require("@/assets/button-assets/tools-button-ns.svg"),
        require("@/assets/button-assets/tools-button-ns.svg"),
        require("@/assets/button-assets/tools-button-ns.svg"),
        require("@/assets/button-assets/tools-button-ns.svg"),
        require("@/assets/button-assets/tools-button-ns.svg"),
      ],
    }
  },


  methods:{

    openUtilsPage(path){
      pageUtils.openPage(this.$router,path)
    },

    openWebPage(url){
      window.location.href=url;

    },

    // 返回红山开源
    backOsredm(){
      window.location.href='https://www.osredm.com';
    },

    getToolsName(){
      var toolsName = this.$route.params.toolName

      console.log(toolsName)
      if(toolsName !== ""){
        //非空 判断是啥
        switch (toolsName){
          case "deepseek":
            // 引入deepseek的数据源
                this.tools = deepseekTools;
                break;
          case "mindspore":
            // 引入deepseek的数据源
            this.tools = mindspore;
            break;
          case "PaddlePaddle":
            // 引入deepseek的数据源
            this.tools = pp;
            break;
          case "qwen":
            // 引入deepseek的数据源
            this.tools = qwen;
            break;
          case "zhipu":
            this.tools = zhipu;
            break;
          case "apache":
            this.tools = apache;
            break;
          default:
            Message.warning("您的地址有误");
            this.$router.push({
              path: '/'
            });

            break;
        }
      }else {
        Message.warning("您的地址有误");
        this.$router.push({
          path: '/'
        });

      }
    }
  },
  components:{
    Footer,

  },

  mounted() {
    this.getToolsName()
    this.vantaEffect = vantaFog({
      el: this.$refs.vantaRef,
      THREE: Three
    })
    // 修改颜色时 cells 需要全大写字母 可生效
    vantaFog({
      el: this.$refs.vantaRef,
      mouseControls: true,
      touchControls: true,
      gyroControls: false,
      minHeight: 200.00,
      minWidth: 200.00,
      highlightColor: 0xfff1fb,
      midtoneColor: 0xffdff3,
      lowlightColor: 0xe0e1fc,
      baseColor: 0xd8d3ff,
      blurFactor: 0.57,
      speed: 3.00,
      zoom: 1.40
    });
  }

}
</script>

<style scoped>












.container{


  margin:  0 auto;
  width: 1400px;
  padding-bottom: 18vh;
  display: flex;
  flex-direction: column;
  justify-content: center;    /* 垂直居中 */
  align-items: center;        /* 水平居中 */
}

.tools-card{

  /* 为需要过渡的属性添加过渡效果 */
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
  height 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
  border-radius 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
  color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
  margin 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
  box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);



  display: flex;
  flex-direction: row;
  align-items: center;
  width: 288px;
  height: auto;
  border-radius: 15px;
  opacity: 1;
  color: black;
  margin: 30px 20px;
  /*float: left;*/

  cursor: pointer;
  user-select: none;
  draggable: false;
  border: 1px solid rgba(0, 0, 0, 0);

  box-shadow: 0px 4px 10px 0px rgba(118, 147, 204, 0.3);
}

.tools-card:hover{

  /* transform属性 */
  transform:translate(0,-10px);
  border: 1px solid #6816ff;

  height: auto;
  border-radius: 15px;
  color: #4b53ff;
  opacity: 1;
  margin: 30px 20px;
  /*float: left;*/

  cursor: pointer;
  user-select: none;
  draggable: false;
  box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.302);
}




.tools-text {

  font-size: 18px;
  font-weight: 700;
  text-align: left;
  top: 0px;

  margin-left: 10px;
  margin-bottom: 10px;
}


.tools-text1{

  font-size: 14px;
  font-weight: 500;
  width: 150px;

  /*color: #525561;*/
  text-align: left;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* 显示的行数 */
  display: -webkit-box;
  overflow: hidden;
  margin-left: 10px;
  margin-top: 10px;
  margin-bottom: 18px;
}

.banner-main{
  position: relative;
  width: 95%;
  height: 350px;


  border-radius: 20px;
}
.banner-img{

  width: 100%;


}

.banner-word{
  position: absolute;
  color: #2d0043;
  font-family: Alibaba;
  font-weight: 500;
  top: 3%;
  left: 0;
  right: 0;
}


.card-border {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 40px;

}

.card-border::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg at 50% 50%, transparent, #946cff 14%, transparent 17%);
  animation: buttonBorderSpin 16s linear infinite;
}

.card-border::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  bottom: 1px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)), linear-gradient(135deg, #e5e5ff -1%, #f9eaff 100%);
  border-radius: 15px;
}

@keyframes buttonBorderSpin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

::v-deep .el-card {
  position: relative;
  z-index: 1;
  border-radius: 15px;
  margin-bottom: 40px;
  border: none;
  background: transparent;
  box-sizing: border-box;
  padding: 20px;
}







a{
  color: #333;
  text-decoration:none;
}

a:link{
  color: #4154F1;
  text-decoration:none;
}

a:hover{
  color: #4154F1;
  text-decoration:none;
}

.search-fm{

  width: 500px;
  height: 40px;
  justify-content: center;
  text-align: center;
  display: flex;
  margin: 0 auto;
  border-radius: 25px;
  border: solid 1px #ddcdff;
  background: rgba(174, 166, 200, 0.11);
}

.search-input{
  width: 100%;
  margin:  0 10px ;
  font-size: 16px;
  font-weight: 550;
  background: transparent;
  border: none;
}

#btn_search{

  top: 0;
  right: 0;
  background: transparent;
  border: 0 !important;
  width: unset;
  height: unset;
  margin: 5px 10px 0 0;

  align-items: center;

  border-radius: 3px;
}

.banner-f{
  font-size: 60px;
  margin-bottom: 30px;
}
/* 二级标题 */
.banner-s{
  font-size: 25px;
}
/* 导航栏 */
.nav-bar{
  width: 1400px;
  height: 70px;
  display: flex;
  text-align: center;
  align-items: center;
  font-weight: 600;
  margin: 0 auto 20px;
}
/* 导航栏LOGO */
.nav-logo{
  margin-left:30px;
  margin-right: 50px;
  width: auto;
  height: 36px;
  cursor: pointer;
}
/* 导航栏首 */
.nav-f{
  margin-left: 20px;
}
/* 导航栏其他按钮 */
.nav-s{
  margin-left: 60px;
}

/* 主卡片 */
.main-card{
  width: 1400px;
  min-height: 100vh;
  margin: 0 auto 0;
}

/* 工具标题 */
.tools-des{

  font-size: 22px;

  font-family: misans;
  font-weight: bold;
  margin: 0 0 auto;


  /* 创建线性渐变背景 */
  background-image: linear-gradient(to right, #5800c3, #f80000);

  /* 将背景裁剪到文字区域 */
  -webkit-background-clip: text;
  background-clip: text;
  /* 隐藏文字的默认填充颜色 */
  -webkit-text-fill-color: transparent;
  text-fill-color: transparent;

}

/* 工具TAG */
.tools-title{
  font-family: misans;
  font-weight: bold;
  font-size: 14px;


  /* 创建线性渐变背景 */
  background-image: linear-gradient(to right, #c459f9, #5961f9);

  /* 将背景裁剪到文字区域 */
  -webkit-background-clip: text;
  background-clip: text;
  /* 隐藏文字的默认填充颜色 */
  -webkit-text-fill-color: transparent;
  text-fill-color: transparent;


  text-align: center;
  margin: 0 20px 0;

  padding: 1px;


  width: 100px;
  height: 100%;
  border: 1px solid #6816ff;
  border-radius: 5px;
}

.tools-main-des{


  margin: 0 5px;

  text-align: left;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;

}

.tools-details-des{
  text-align: left;
  margin: 0 20px;
}


/* 工具子描述 */
.tools-child-des{

  font-size: 16px;

  font-family: misans;
  font-weight: bold;
  margin: 30px 0 auto;


  /* 创建线性渐变背景 */
  background-image: linear-gradient(to right, #5800c3, #f80000);

  /* 将背景裁剪到文字区域 */
  -webkit-background-clip: text;
  background-clip: text;
  /* 隐藏文字的默认填充颜色 */
  -webkit-text-fill-color: transparent;
  text-fill-color: transparent;

}






/* 移动端适配 */
@media screen and (max-width: 425px) {

  /* 工具标题 */
  .tools-des{
    font-size: 18px;

  }

  /* 工具TAG */
  .tools-title{

    font-weight: bold;
    font-size: 10px;

    text-align: center;
    margin: 10px 20px 0;

    padding: 1px;


    width: 80px;
    height: 100%;
    border: 1px solid #6816ff;
    border-radius: 5px;
  }


  .tools-details-des{
    text-align: center;
    margin: 0 20px;
  }

  .tools-main-des{


    font-size: 10px;
    margin: 0 5px;
    flex-direction: column;
    text-align: center;
    display: flex;

    flex-wrap: wrap;
    align-items: center;

  }

  .container{
    max-width: 1024px;
    min-width: 400px;
    margin:  0 auto;
    width: 400px;
    padding-bottom: 1vh;
    display: flex;
    flex-direction: column;
    justify-content: center;    /* 垂直居中 */
    align-items: center;        /* 水平居中 */
  }


  .banner-main{
    position: relative;
    width: 95%;
    height: 250px;


    border-radius: 20px;
  }

  /* 一级标题 */
  .banner-f{
    font-size: 40px;
  }
  /* 二级标题 */
  .banner-s{
    font-size: 20px;
  }



  /* 搜索 */
  .search-fm{

    width: 320px;
    height: 30px;
    justify-content: center;
    text-align: center;
    display: flex;
    margin: 0 auto;
    border-radius: 25px;
    border: solid 1px #ddcdff;
    background: rgba(174, 166, 200, 0.11);
  }

  .search-input{
    width: 100%;
    margin:  0 10px ;
    font-size: 14px;
    font-weight: 550;
    background: transparent;
    border: none;
  }

  #btn_search{

    top: 0;
    right: 0;
    background: transparent;
    border: 0 !important;
    width: unset;
    height: unset;
    margin: 1px 3px 0 0;

    align-items: center;

    border-radius: 3px;
  }




  /* 导航栏 */
  .nav-bar{
    max-width: 1024px;
    min-width: 400px;

    width: 400px;
    height: 70px;
    display: flex;
    text-align: center;
    align-items: center;
    font-weight: 600;
    margin: 0 auto 20px;
  }




  /* 导航栏LOGO */
  .nav-logo{
    margin-left:20px;
    margin-right: 20px;
    width: auto;
    height: 22px;
    cursor: pointer;
  }
  /* 导航栏首 */
  .nav-f{
    margin-left: 0px;
    font-size: 10px;
  }
  /* 导航栏其他按钮 */
  .nav-s{
    margin-left: 20px;
    font-size: 10px;
  }


  /* 主卡片 */
  .main-card{
    width: 380px;
    margin: 0 auto 0;
  }

}


</style>
